package com.huidao.ui;

import java.util.Scanner;

import com.huidao.service.FoodService;
import com.huidao.service.MealsSetService;

public class FoodMenu {
	private static final int STOP = 1;
	private static final int MEATSET = 1;
	private static final int ADD = 1;
	private static final int DEL = 2;
	private static final int CHANGE = 3;
	private static Scanner sc = new Scanner(System.in);
	public void operation(){
		System.out.println("--------菜品以及套餐管理------");
		System.out.println("请输入您要执行的操作：1-->添加菜品/套餐，2-->删除菜品/套餐，3-->修改菜品/套餐");
		int operation = sc.nextInt();
		switch (operation) {
		case ADD:{
			while(true){
				System.out.println("停止菜品、套餐界面操作请输入1");
				if (sc.nextInt()==STOP) {
					break;
				}
				System.out.println("添加套餐请输入1，添加菜品请输入2");
				if (sc.nextInt()==MEATSET) {
					new MealsSetService().add();
					break;
				}
				new FoodService().add();
			}
			break;
		}
		case DEL:{
			while(true){
				System.out.println("停止菜品、套餐界面操作请输入1");
				if (sc.nextInt()==STOP) {
					break;
				}
				System.out.println("删除套餐请输入1，删除菜品请输入2");
				if (sc.nextInt()==MEATSET) {
					new MealsSetService().del();
					break;
				}
				new FoodService().del();
				break;
			}
		}
		case CHANGE:{
			while(true){
				System.out.println("停止菜品、套餐界面操作请输入1");
				if (sc.nextInt()==STOP) {
					break;
				}
				System.out.println("修改套餐请输入1，修改菜品请输入2");
				if (sc.nextInt()==MEATSET) {
					new MealsSetService().change();
					break;
				}
				new FoodService().change();
				break;
			}
		}
		default:
			break;
		}
	}
}
